﻿using AiXiu.Common;
using AiXiu.Model;
using Reservoir.DAL;
using Reservoir.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Reservoir.BLL
{
    public class RecordBLL
    {
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <returns></returns>
        RecordDAL recordDAL = new RecordDAL();
        VodHelper vodHelper = new VodHelper();

        public List<TBRecord> GetTBUsers()
        {
            return recordDAL.GetTBRecord();
        }
        public List<TBRecord> GetByTBUsers(string UserId)
        {
            return recordDAL.GetByTBRecord(UserId);
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="user">用户信息</param>
        /// <returns></returns>
        public OperResult AddRecord(TBRecord record)
        {
            if (recordDAL.AddRecord(record) > 0)
            {
                return OperResult.Succeed();
            }
            else
            {
                return OperResult.Failed();
            }
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="videoIds">视频Id</param>
        public OperResult DeleteVideo(int Id)
        {
            // 从数据库删除
            int res = recordDAL.DeleteVideo(Id);
            if (res > 0)
            {
                return OperResult.Succeed();
            }
            else
            {
                return OperResult.Failed("数据库删除失败！");
            }
        }
    }
}
